import QtQuick 1.0

Rectangle {
    id: idComment
    width: 200
    height: 340
    radius: 7
    border.width: 3
    border.color: "#07AA1D"

    property alias text: idTextEdit.text

    signal okPressed(string userMessage)

    Rectangle {
        id: idRectangleTitle
        color:  "#07AA1D"
        width: parent.width
        radius: 7
        border.width: 3
        border.color: "#07AA1D"
        height: 50
        anchors.top: parent.top


        gradient: Gradient {
            GradientStop {
                position: 0.00;
                color: "#47EA5D";
            }
            GradientStop {
                position: 0.50;
                color: "#000000";
            }
            GradientStop {
                position: 1.00;
                color: "#47EA5D";
            }
        }
        opacity: 1.0


        Text {
            id: idTitle
            anchors.fill: parent
            anchors.topMargin: 12
            text: "Comments?"
            smooth: true
            verticalAlignment: Text.AlignTop
            horizontalAlignment: Text.AlignHCenter
            font.pixelSize: 18
            font.bold: true
            color: "white"
        }
    }

    TextEdit {
        id: idTextEdit
        width: parent.width
        text: ""
        anchors.top: idRectangleTitle.bottom
        anchors.right: parent.right
        anchors.bottom: parent.bottom
        anchors.left: parent.left
        anchors.topMargin: 6
        anchors.bottomMargin: 60
        anchors.leftMargin: 5
        anchors.rightMargin: 5
        font.pixelSize: 16
    }


    Button { id: idButtonOk
        source: "art/ok.png"
        width: 64
        height: 64
        anchors.top: idTextEdit.bottom
        anchors.topMargin: 5
        anchors.right: idTextEdit.right
        anchors.rightMargin: 25
        onPressed: {
            idComment.okPressed(idTextEdit.text)
//            idLoginSignup.state = "LoggingIn"
//            idLoginSignup.loggingIn();
//            loginWorker.sendMessage({'username': idTextInputUserName.text, 'password': idTextInputPassword.text, 'g': G.g});
        }
    }

    Button { id: idButtonCancel
        source: "art/cancel.png"
        width: 64
        height: 64
        anchors.left: idTextEdit.left
        anchors.leftMargin: 25
        anchors.verticalCenter: idButtonOk.verticalCenter
        onPressed: {
            idComment.opacity = 0
        }
    }


}
